<template>
    <div class="menu-tree">
        <label v-for="list in dataList" :key="list.id">
            <el-submenu :index="list.id" v-if="list.child">
                <template slot="title">
                    <i class="el-icon-location" v-if="list.level"></i>
                    <span>{{ list.name }}</span>
                </template>
                <label>
                    <child-menu :dataList="list.child"></child-menu>
                </label>
            </el-submenu>
            <el-menu-item v-else :index="list.index">
                <span slot="title">{{ list.name }}</span>
            </el-menu-item>
        </label>
    </div>
</template>

<script>
export default {
    name: "childMenu",
    props: ["dataList"]
};
</script>
